package com.example.demo.service;

import com.example.demo.mapper.RoomMapper;
import com.example.demo.pojo.Room;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomService {
    @Autowired
    private RoomMapper roomMapper;

    public List<Room> getRoomAll() {
        return roomMapper.getRoomAll();
    }

    public int getRoomCount(){
        return roomMapper.getRoomCount();
    }

    public int addRoom(int roomID, int floor, int roomTelephone, String typeName,int typeID) {
        return roomMapper.addRoom(roomID,floor,roomTelephone,typeName,typeID);
    }

    public int updateRoomStateByRoomID(int roomState, int roomID) {
        return roomMapper.updateRoomStateByRoomID(roomState,roomID);
    }

    public int updateRoomTypeByRoomID(String typeName, int roomID) {
        return roomMapper.updateRoomTypeByRoomID(typeName,roomID);
    }

    public int updateRoomByRoomID(int roomID, int floor, int roomTelephone, String typeName,int typeID) {
        return roomMapper.updateRoomByRoomID(roomID,floor,roomTelephone,typeName,typeID);
    }

    public int deleteRoomByRoomID(int roomID) {
        return roomMapper.deleteRoomByRoomID(roomID);
    }

}
